package com.shenhan.channel;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.channels.SocketChannel;

/**
 * <br>
 *
 * <p>- <br>
 *
 * @author shenhan
 * @version 1.0
 * @date: 2022/5/16 17:16
 * @description:
 */
public class SocketChannelDemo {

  public static void main(String[] args) {
    SocketChannel socketChannel = null;
    try {
      socketChannel = SocketChannel.open();
      socketChannel.configureBlocking(false);
      socketChannel.connect(new InetSocketAddress("127.0.0.1", 80));
      while (!socketChannel.finishConnect()) {
        System.out.println("aba");
      }
    } catch (IOException e) {
      e.printStackTrace();
    }


  }
}
